#include <drogon/drogon.h>
#include <iostream>

#include <thread>

using namespace std;
using namespace drogon;

int main()
{
// Load config file
#ifdef DEV
    std::string_view configPath = "../server/config.json";
#else
    std::string_view configPath = "./server/config.json";
#endif
    drogon::app().loadConfigFile(std::string(configPath));

    std::thread dg_run_th([]() { drogon::app().run(); });

    if (dg_run_th.joinable()) {
        dg_run_th.join();
    }

    return 0;
}
